﻿using System.ComponentModel;

namespace Super.Hmi.Utils.ThemeManager
{
    /// <summary>
    /// 通用设置
    /// </summary>
    public class GeneralSettings : ThemeViewModelBase
    {
        private General _general = new General();
        /// <summary>
        /// 通用
        /// </summary>
        public General General
        {
            get => _general;
            set => SetProperty(ref _general, value);
        }
        private Animation _animation = new Animation();
        /// <summary>
        /// 动画
        /// </summary>
        public Animation Animation
        {
            get => _animation;
            set => SetProperty(ref _animation, value);
        }
    }
    /// <summary>
    /// 动画
    /// </summary>
    public class Animation : ThemeViewModelBase
    {
        private bool _pageSwitchingProgressBar = false;
        /// <summary>
        /// 页面切换进度条
        /// </summary>
        public bool PageSwitchingProgressBar
        {
            get => _pageSwitchingProgressBar;
            set => SetProperty(ref _pageSwitchingProgressBar, value);
        }
        private bool _pageSwitchingLoading = true;
        /// <summary>
        /// 页面切换Loading
        /// </summary>
        public bool PageSwitchingLoading
        {
            get => _pageSwitchingLoading;
            set => SetProperty(ref _pageSwitchingLoading, value);
        }
        private bool _pageSwitchingAnimationEnable = false;
        /// <summary>
        /// 页面切换动画是否开启
        /// </summary>
        public bool PageSwitchingAnimationEnable
        {
            get { return _pageSwitchingAnimationEnable; }
            set { SetProperty<bool>(ref _pageSwitchingAnimationEnable, value); }
        }
        private PageSwitchingAnimationType _pageSwitchingAnimation = PageSwitchingAnimationType.None;
        /// <summary>
        /// 页面切换动画
        /// </summary>
        public PageSwitchingAnimationType PageSwitchingAnimation
        {
            get => _pageSwitchingAnimation;
            set => SetProperty(ref _pageSwitchingAnimation, value);
        }
    }
    /// <summary>
    /// 通用
    /// </summary>
    public class General : ThemeViewModelBase
    {
        private LanguageType _language = LanguageType.Chinese;
        /// <summary>
        /// 语言
        /// </summary>
        public LanguageType Language
        {
            get => _language;
            set
            {
                SetProperty(ref _language, value);
                LanguageHelper.Instance.SwitchLanguage(value.ToString());
            }
        }
        private bool _dynamicTitle = false;
        /// <summary>
        /// 动态标题
        /// </summary>
        public bool DynamicTitle
        {
            get => _dynamicTitle;
            set => SetProperty(ref _dynamicTitle, value);
        }
        private bool _watermarkEnable = false;
        /// <summary>
        /// 是否开启水印
        /// </summary>
        public bool WatermarkEnable
        {
            get => _watermarkEnable;
            set => SetProperty(ref _watermarkEnable, value);
        }
        private string _watermarkValue = "Super Admin NB";
        /// <summary>
        /// 水印内容
        /// </summary>
        public string WatermarkValue
        {
            get { return _watermarkValue; }
            set { SetProperty<string>(ref _watermarkValue, value); }
        }
        private bool _regularlyCheckForUpdates = true;
        /// <summary>
        /// 定时检查更新
        /// </summary>
        public bool RegularlyCheckForUpdates
        {
            get => _regularlyCheckForUpdates;
            set => SetProperty(ref _regularlyCheckForUpdates, value);
        }
        private bool _closeAndShrinkToTheWorkspace;
        /// <summary>
        /// 关闭缩小到工作区
        /// </summary>
        public bool CloseAndShrinkToTheWorkspace
        {
            get { return _closeAndShrinkToTheWorkspace; }
            set { SetProperty<bool>(ref _closeAndShrinkToTheWorkspace, value); }
        }
    }
    /// <summary>
    /// 页面切换动画
    /// </summary>
    public enum PageSwitchingAnimationType
    {
        None,
    }
    /// <summary>
    /// 语言类型
    /// </summary>
    public enum LanguageType
    {
        [Description("简体中文")]
        Chinese,
        English,
        [Description("日本語で")]
        Japanese
    }
}
